//
//  SWProfileChartView.swift
//  ChildStory
//
//  Created by linhan on 2016/12/14.
//  Copyright © 2016年 Aiya. All rights reserved.
//

import Foundation
import UIKit
class SWProfileChartView: UIView
{
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setup()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setup()
    {
        backgroundColor = UIColor.white
        
        if let image = UIImage(named:"profile_img_chart.jpg")
        {
            let rate:CGFloat = image.size.width / image.size.height
            let imageHeight:CGFloat = width / rate
            let imageView = UIImageView()
            imageView.frame = CGRectMake(0, 0, width, imageHeight)
            imageView.image = image
            height = imageHeight
            addSubview(imageView)
        }
    }
    
    
}
